<?php
    if($query->num_rows()>0){
        $admin_data = $query->row();
        $identity = $admin_data->ident;
        $first_name = $admin_data->first_name;
        $last_name = $admin_data->last_name;
        $id = $admin_data->id;
    }
?>
<div align="center" class="information"></div>
<table class="titrepage" width="1000px">
    <tr>
        <?php if($this->session->userdata('level')==1){?>              
        <td>
            <a class="titrea" href="<?php echo site_url('avis_admin/list_admins')?>">List admins</a>
            | <a class="titrea" href="<?php echo site_url('avis_admin/add_admin')?>">Add admin</a>
        </td>
        <?php }?>
        <td>
            <a class="titrea" href="<?php echo site_url('avis_admin/list_users')?>">List users</a>
            | <a class="titrea" href="<?php echo site_url('avis_admin/add_user')?>">Add user</a>
        </td>
    </tr>
</table>
<br/>
<div class="bajouter" align="center">Ajouter un admin</div>
<div style="margin:10px 0px 10px 0px;">
    <form   method="POST" id="formcheck" action="<?php echo site_url('avis_admin/update_admin').'/'.$id?>" enctype="multipart/form-data">
        <table width="100%" id="formactu" cellpadding="10px" cellspacing="0">
            <tr>
                <td><span>Identifiant </span><input  type="text"   name="ident" value="<?php echo $identity;?>" readonly="readonly" /><br/></td>
                <td><span>Nom </span><input  type="text"  name="nom" value="<?php echo $first_name;?>" /><br/></td>
                <td><span>Last name </span><input  type="text"  name="last_name" value="<?php echo $last_name?>" /><br/></td>
                <td><input type="image" name="submit"  border="0" src="<?php echo base_url().'assets/css/'?>images/ajouter.png"  value="Submit" alt="Submit"></td>
            </tr>
        </table>
       <?php echo validation_errors(); ?>
    </form>
</div>